//
//  GWSettingViewController.m
//  新浪微博
//
//  Created by qianfeng on 16/2/25.
//  Copyright (c) 2016年 高炜. All rights reserved.
//

#import "GWSettingViewController.h"
#import "GWDiscoverItemGroup.h"
#import "GWDiscoverItem.h"
#import "GWDiscoverCell.h"
#import "GWCommonIArrowtem.h"
#import "GWCommonSwitchItem.h"
#import "GWCommonLabelItem.h"
#import "GWGeneralSettingController.h"
@interface GWSettingViewController ()

@end

@implementation GWSettingViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title =@"设置";
    [self addGroup0];
    [self addGroup1];
    [self addGroup2];
    [self addGroup3];
    
    [self setupTableFooterView];
    // Do any additional setup after loading the view.
}

-(void)setupTableFooterView
{
    UIButton *btn =[[UIButton alloc]init];

    [btn setTitle:@"退出当前账号" forState:UIControlStateNormal];
    [btn setBackgroundImage:[UIImage reSizeWithName:@"common_card_background"] forState:UIControlStateNormal];
    [btn setBackgroundImage:[UIImage imageNamed:@"common_card_background_highlighted"] forState:UIControlStateHighlighted];
    btn.height =40;
    [btn setTitleColor:myColor(230, 10, 10) forState:UIControlStateNormal];
    btn.titleLabel.font =[UIFont systemFontOfSize:14];
    self.tableView.tableFooterView =btn;
}
-(void)addGroup0
{
    GWDiscoverItemGroup *group =[[GWDiscoverItemGroup alloc]init];
    
    GWCommonIArrowtem *account =[GWCommonIArrowtem itemWithTitle:@"账号管理"];
    
    group.items =@[account];
    [self.itemGroups addObject:group];
}
-(void)addGroup1
{
    GWDiscoverItemGroup *group =[[GWDiscoverItemGroup alloc]init];
    
    GWCommonIArrowtem *account =[GWCommonIArrowtem itemWithTitle:@"主题、背景"];
    
    group.items =@[account];
    [self.itemGroups addObject:group];
}
-(void)addGroup2
{
    GWDiscoverItemGroup *group =[[GWDiscoverItemGroup alloc]init];
    
    GWCommonIArrowtem *account =[GWCommonIArrowtem itemWithTitle:@"通知提醒"];
    GWCommonIArrowtem *setting =[GWCommonIArrowtem itemWithTitle:@"通用设置"];
    setting.pushClass =[GWGeneralSettingController class];
    GWCommonIArrowtem *safe =[GWCommonIArrowtem itemWithTitle:@"隐私与安全"];
    
    group.items =@[account,setting,safe];
    [self.itemGroups addObject:group];
}
-(void)addGroup3
{
    GWDiscoverItemGroup *group =[[GWDiscoverItemGroup alloc]init];
    
    GWCommonIArrowtem *account =[GWCommonIArrowtem itemWithTitle:@"意见与反馈"];
     GWCommonIArrowtem *about =[GWCommonIArrowtem itemWithTitle:@"关于微博"];
    group.items =@[account,about];
    [self.itemGroups addObject:group];
}


@end
